﻿using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Data.SqlClient;


namespace SalePartial.Model
{

	public class CategoriesInfo
	{

		private Guid mstrID;
		private bool mbIsParent;
		private string mstrName;
		private Guid mstrParentID;
		private int mintOpSeq;

		public Guid ID {
			get { return mstrID; }
			set { mstrID = value; }
		}

		public bool IsParent {
			get { return mbIsParent; }
			set { mbIsParent = value; }
		}

		public string Name {
			get { return mstrName; }
			set { mstrName = value; }
		}

		public Guid ParentID {
			get { return mstrParentID; }
			set { mstrParentID = value; }
		}

		public int OpSequence {
			get { return mintOpSeq; }
			set { mintOpSeq = value; }
		}


		public CategoriesInfo()
		{
		}


		public CategoriesInfo(SqlDataReader dr)
		{
			mstrID = new Guid(dr["categoryID"].ToString());
			mstrName = dr["name"].ToString();

			if (!Information.IsDBNull(dr["parentID"])) {
				mstrParentID = new Guid(dr["parentID"].ToString());
			}

			mbIsParent = Convert.ToBoolean(dr["isParent"]);
			mintOpSeq = Convert.ToInt32(dr["opSequence"]);

		}

	}

}
